package PhienBanIO;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.Reader;
import java.io.Writer;

public class DocGhiTheoDong {
	public static void main (String [] args){
		try {
			FileInputStream fin = new FileInputStream("D:\\a.txt");
			Reader r= new InputStreamReader(fin, "UTF8");
			BufferedReader br = new BufferedReader(r);
			StringBuilder text = new StringBuilder();
			String line =null;
			
			FileOutputStream fout = new FileOutputStream("D:\\out1.txt");
			Writer out = new OutputStreamWriter(fout,"UTF8");
			
			while ((line = br.readLine())!= null){
				
				System.out.println(line);
				out.write(line+"\n");
				
			}
			br.close();
			out.close();
			fin.close();
			fout.close();
		}
		
		catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			}
		
	}
}
